const HtmlWebpackPlugin = require('html-webpack-plugin');
const { resolve } = require('path');
module.exports = {
    entry:'./src/js/index.js',
    output:{
        path:resolve(__dirname,'dist'),
        filename:'bundle.js'
    },

    mode: 'development', //development 开发环境 production 生产环境
    devtool:'source-map',
    plugins:[
        new HtmlWebpackPlugin({
            template:resolve(__dirname,'src/index.html')
        })
    ],

    devServer:{
        // contentBase:'./',
        static:'./',
        open:true,
    }
}